home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000119_icon-group-sender _Thu May 16 03:37:24 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Thu, 16 May 1996 08:41:13 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: 16 May 1996 03:37:24 GMT
  4. From: midtoad@cadvision.com (Stewart Midwinter)
  5. Message-Id: <4ne7tk$17vo@elmo.cadvision.com>
  6. Organization: Wings of Gaia
  7. Sender: icon-group-request@cs.arizona.edu
  8. Reply-To: midtoad@cadvision.com
  9. Subject: 'Word wrap' utility
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: O
  12.  
  13. I'm only getting started in icon, but want to create a little utility.
  14.  Before I do though, I should ask whether I'm reinventing the wheel
  15. and whether anyone else has already done this.  I have written the
  16. utility in turbo pascal, and am happy with its performance, but want
  17. to test the claim that icon is better at string handling.  So far,
  18. some of the icon concepts are confusing to me.  
  19.  
  20. Anyway, here's the concept of the strip utility:
  21.  
  22. Often we receive mail messages, or FAQs, or other items that, when
  23. printed through a word processor or other program in proportional font
  24. instead of courier font, look terrible, since the lines are too short
  25. and of uneven length.  The idea is to strip out all hard carriage
  26. returns within paragraphs, so that the full line length is used. 
  27. Looks much nicer, but manually is not the way!
  28.  
  29. The problem centers around how to tell what carriage returns to strip
  30. out:
  31. - yes if the line is followed by another line of text
  32. - no on lines of text followed by blank lines or lines containing only
  33. spaces (we presume these are the last line of a paragraph)
  34. - no on lines containing only spaces (we presume these lines are there
  35. to create vertical white space)
  36. - no on lines whose first non-space character is a number (we presume
  37. these are table list items)
  38. - no on lines whose first non-space character is in a user-definable
  39. list of symbols (e.g.: / \<< >> etc.), typically these symbols would
  40. be stored in a *.ini file (we presume that the user may have reason to
  41. over-ride the program's logic by manually indicating certain lines
  42. should be left as is (e.g. lines of a poem)
  43.  
  44. Some idea of how to approach the problem can be had by looking in the
  45. icon library at yescr.icn and nocr.icn, which convert DOS line endings
  46. to unix line endings (and vice versa).
  47.  
  48. Any suggestions on how to approach this, or has it been done already?
  49.  
  50. Cheers,
  51.  
  52. Stewart Midwinter
  53. created with OS/2 Warp and Neologic News 4.5
  54.  
  55.